﻿@using LaxCraft.Repositories;
@using LaxCraft.Domain;
@using LaxCraft.Helpers;
@model LaxCraft.Domain.Post
@{
    ViewBag.Title = "Edit:" + @Model.Title;
}
<h2>Edit Post</h2>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
    <fieldset>
        @Html.HiddenFor(model => model.Id)
        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title) @Html.ValidationMessageFor(model => model.Title)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Body)
        </div>
        <div class="editor-field">
            @{ Html.Telerik().EditorFor(model => model.Body)
                .HtmlAttributes(new { style = "height:400px" })
                .Encode(false)
                .Render();
                }
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Tags)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Tags) @Html.ValidationMessageFor(model => model.Tags)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.CreatedBy)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CreatedBy) @Html.ValidationMessageFor(model => model.CreatedBy)
        </div>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
